import { defineStore } from 'pinia';
import type * as Type from './type';

const useTaskInfo = defineStore('TaskInfo', {
  state: (): Type.TaskInfoState => ({
    taskId: 0,
    titleContent: [
      {
        label: "创建人",
        value: "",
      },
      {
        label: "创建时间",
        value: "",
      },
      {
        label: "任务状态",
        value: undefined,
      },
    ],
    currentType: 0,
    openTaskData: {
      taskName: '',
      beginDate: '',
      endDate: '',
      taskMethodType: '',
      totalUserNum: 0
    },
    contractTaskData: {
      taskName: '',
      beginDate: '',
      endDate: '',
      taskMethodType: '',
      tableData: []
    },
    imageLayout: ''
  }),
  actions: {
    setTaskInfoState(partial: Partial<Type.TaskInfoState>) {
      this.$patch(partial);
    }
  }
});

export default useTaskInfo;